package hello.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;

import java.util.Date;

@Service
public class JedisService {

    @Autowired
    Jedis jedis;

    public void useJedis() {
        jedis.set("date", "2024-08-29");
        System.out.println(jedis.get("date"));

        jedis.incr("number");

        System.out.println(jedis.get("number"));

        jedis.incr("number");
        jedis.incrBy("number", 20);
        System.out.println(jedis.get("number"));
    }
}
